import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/SCLoginView.vue')
    }, {
      path: '/sc',
      name: 'sc',
      component: () => import('../views/SC.vue'),
      children: [
        {
          path: '/gridmanage/physicalgird1',
          name: 'physicalgird1',
          component: () => import('../views/GridManage/PhisicalGridView.vue')
        }
      ]
    },
    {//main home index 
      path: '/main',
      name: 'layout',
      component: () => import('../views/LayoutView.vue'),
      children: [
        {
          path: '/basicData/adminSetting',
          name: 'adminSetting',
          component: () => import('../views/BasicData/AdminSettingView.vue')
        }, {
          path: '/basicData/gridEmploy',
          name: 'gridEmploy',
          component: () => import('../views/BasicData/GridEmployView.vue')
        }, {
          path: '/basicData/gridType',
          name: 'gridType',
          component: () => import('../views/BasicData/GridTypeView.vue')
        }, {
          path: '/basicData/log',
          name: 'log',
          component: () => import('../views/BasicData/LogView.vue')
        }, {
          path: '/gridmanage/gridCreateGade',
          name: 'gridCreateGade',
          component: () => import('../views/GridManage/GridCreateGadeView.vue')
        }, {
          path: '/gridmanage/levelview',
          name: 'levelview',
          component: () => import('../views/GridManage/LevelView.vue')
        }, {
          path: '/gridmanage/gridCreate',
          name: 'gridCreate',
          component: () => import('../views/GridManage/CreateGridView.vue')
        }, {
          path: '/gridmanage/createTeam',
          name: 'createTeam',
          component: () => import('../views/GridManage/CreateTeamView.vue')
        }, {
          path: '/gridmanage/loginsystem',
          name: 'loginsystem',
          component: () => import('../views/GridManage/LoginSystemView.vue')
        }, {
          path: '/gridmanage/physycalgird',
          name: 'physycalgird',
          component: () => import('../views/GridManage/PhysicalGirdView.vue')
        }, {
          path: '/gridmanage/logicgrid',
          name: 'logicgrid',
          component: () => import('../views/GridManage/LogicGridView.vue')
        }
      ]
    },
    {
      path: '/map',
      name: 'map',
      component: () => import('../views/MapView.vue')
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue')
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    }, {
      path: '/main',
      name: 'main',
      component: () => import('../views/MainView.vue')
    },
  ]
})

export default router
